﻿package keyfun.events
{
	import flash.events.Event;
	
	public class XMLLoaderEvent extends Event
	{
		public static const ON_COMPLETE:String = "on_xml_complete";
		public static const ON_LOADING:String = "on_xml_loading";
		public static const ON_ERROR:String = "on_xml_error";
		public var bytesLoaded:Number;
		public var bytesTotal:Number;
		public var dataXML:XML;
		
		public function XMLLoaderEvent(type:String, v:Object=null) 
		{
			super(type, true);
			switch(type)
			{
				case ON_COMPLETE:
				dataXML = v.xml;
				break;
				
				case ON_LOADING:
				bytesLoaded = v.bytesLoaded;
				bytesTotal = v.bytesTotal;
				break;
			}
		}
	}
	
}